
app:registClass("TheatreController", "app.theatre.controllers.TheatreController")

app:registInst(import(".models.TheatreModel").new())

app:registInst(app:getClass("TheatreController").new({type="world", zOrder=SceneZOrder.chatUiZOrder}))

local model = app:getInst("TheatreModel")

-- 开始歌剧院
app.session:on("pb_theatre.S2C_TheatreInfo", function(msg)
	model:S2C_TheatreInfo(msg)
end)

-- 歌剧院逃跑
app.session:on("pb_theatre.S2C_TheatreEscape", function(msg)
	dump(msg, "S2C_TheatreEscape")
end)

-- 剧场状态同步
app.session:on("pb_theatre.S2C_UpdateSessionState", function(msg)
	model:S2C_UpdateSessionState(msg)
end)

-- 对方boss血量同步
app.session:on("pb_theatre.S2C_UpdateBossHp", function(msg)
	model:S2C_UpdateBossHp(msg)
end)

-- 战斗场次结束
app.session:on("pb_theatre.S2C_SessionResult", function(msg)
	model:S2C_SessionResult(msg)
end)

-- 剧场结束
app.session:on("pb_theatre.S2C_TheatreResult", function(msg)
	model:S2C_TheatreResult(msg)
end)